package com.qixin.total.controller;

import com.qixin.api.bean.PtMoneyInfo;
import com.qixin.api.bean.ResultPage;
import com.qixin.api.bean.VoPage;
import com.qixin.api.service.PtMoneyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * 李许多
 * 分配记录
 * Created by aa on 2018/11/1.
 */
@Controller
@RequestMapping("/caradmin")
public class PtMoneyInfoController {

    @Autowired
    PtMoneyInfoService ptMoneyInfoService;

    /**
     * 跳转分配记录页面
     * @return
     */
    @RequestMapping("/Distribution.html")
    public String Distribution(){
        return "pingtai/Distribution";
    }

    /**
     * 跳转充值记录页面
     * @return
     */
    @RequestMapping("/Recharge.html")
    public String Recharge(){
        return "pingtai/Recharge";
    }

    /**
     * 查询并分页分配
     * @param voPage
     * @return
     */
    @RequestMapping("/distributionList")
    @ResponseBody   // TODO: 2018/11/17 错误！！！！这是什么？
    public ResultPage<PtMoneyInfo> distributionList(VoPage voPage, HttpSession session,PtMoneyInfo ptMoneyInfo){
        ptMoneyInfo.setFlag(1);
        return ptMoneyInfoService.selectMyPage(voPage,session,ptMoneyInfo);
    }

    /**
     * 查询充值
     * @param voPage
     * @return
     */   // TODO: 2018/11/17 错误！ 充值 是平台充值企业   而不是 企业的分配车辆金额的东西！
    @RequestMapping("/RechargeList")
    @ResponseBody
    public ResultPage<PtMoneyInfo> RechargeList(VoPage voPage, HttpSession session,PtMoneyInfo ptMoneyInfo){

        ptMoneyInfo.setFlag(2);
        return ptMoneyInfoService.selectMyPage(voPage,session,ptMoneyInfo);
    }

}
